﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BL.objects
{
    public class NodesEdge
    {
        int m_Id;
        Node m_InVertex;
        Node m_OutVertex;
        public double Weight { get; set; }

        public NodesEdge(Node node, Node node2, Edge edge)
        {            
            m_InVertex = node;
            m_OutVertex = node2;
            Weight = edge.Weight;
        }


        public bool EligibleForNodeTraverse(Node node)
        {
            return ((m_InVertex == node) && (!m_OutVertex.Visited)) || ((m_OutVertex == node) && (!m_InVertex.Visited));
        }

        public Node GetSecondNode(Node node)
        {
            if (m_InVertex == node)
                return m_OutVertex;
            else
                return m_InVertex;
        }

        
    }
}
